package com.project.common.service.impl;

import com.project.common.entity.SysUserRole;
import com.project.common.mapper.SysUserRoleMapper;
import com.project.common.service.SysRoleUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SysRoleUserImpl implements SysRoleUserService {
    @Autowired
    private SysUserRoleMapper mapper;
    @Override
    public List<SysUserRole> queryByUserId(Integer userId) {
        return mapper.queryByUserId(userId);
    }

    @Override
    public int deleteByPrimaryKey(Integer userId) {
        return mapper.deleteByPrimaryKey(userId);
    }

    @Override
    public int insert(SysUserRole record) {
        return mapper.insert(record);
    }

    @Override
    public int insertSelective(SysUserRole record) {
        return mapper.insertSelective(record);
    }

    @Override
    public SysUserRole selectByPrimaryKey(Integer userId) {
        return mapper.selectByPrimaryKey(userId);
    }

    @Override
    public int updateByPrimaryKeySelective(SysUserRole record) {
        return mapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(SysUserRole record) {
        return mapper.updateByPrimaryKey(record);
    }

    @Override
    public int deleteByUserId(Integer userId) {
        return mapper.deleteByUserId(userId);
    }

    @Override
    public int deleteByUserIdAndRoleId(Integer userId, Integer roleId) {
        return mapper.deleteByUserIdAndRoleId(userId, roleId);
    }

    @Override
    public List<SysUserRole> selectByUserIdAndRoleId(Integer userId, Integer roleId) {
        return mapper.selectByUserIdAndRoleId(userId, roleId);
    }
}
